package com.aaa.charge.api.CareHistory;

import com.aaa.charge.service.CareTuiService;
import com.aaa.charge.service.DisPensingService;
import com.aaa.vo.Result;
import com.sun.org.apache.regexp.internal.RE;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author pzs
 * @date 2023/3/30 19:33
 * @description ApiDispensing
 */
@RestController
@RequestMapping("charge/api/dispensing")
public class ApiDispensing {
    @Resource
    private DisPensingService disPensingService;

    /**
     * 处方发药
     * 查询病列 处方
     */
    @GetMapping("getDisPensingRegId/{regId}")
    public Result<Map<String,Object>> findcareHistory(@PathVariable String regId){
        return disPensingService.findcareHistory(regId);
    }

    /**
     * 发药
     */
     @GetMapping("disPensing/{itemId}")
    public Result<Boolean> disPensing(@PathVariable String[] itemId) {
         return disPensingService.upDisPensing(itemId);
     }
}
